<?php
/**
*
* 功能描述（主页控制器）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*/

class CtrlIndex extends CtrlBase
{

	function Index()
	{
		$indexObj = $this->GetModel("Index");
		$data = $indexObj->GetDisImg();
		$this->assign("disImg", json_encode($data));
		$this->assign("img_cnt", count($data));
		$this->assign("img_first", $data[0]);
		$data = $indexObj->GetShowCake();
		$cnt = count($data);
		$i = 0;
		while($cnt > 0 && $cnt < 8)
		{
			$data[] = $data[$i++];
			$cnt++;
		}
		$this->assign("cakes", $data);
		return 2;
	}
}

